package com.csdj.essay.controller;


import com.csdj.essay.common.WebResult;
import com.csdj.essay.common.WebResultMsgCode;
import com.csdj.essay.service.AttquesCommentService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 评论表(问题和文章) 前端控制器
 * </p>
 *
 * @author 刘宇
 * @since 2022-03-17
 */
@RestController
@RequestMapping("/attques-comment")
public class AttquesCommentController {

    @Resource
    private AttquesCommentService attquesCommentService;

    /**
     * 查询问题评论条数，推荐模块里面的，对应问题id
     * 前端需要传id到地址栏
     * @return
     */
    @GetMapping("/getComment")
    public WebResult getComment(){
        int jg = attquesCommentService.comment();
        return new WebResult(WebResultMsgCode.SUCCESS).putData("getComment",jg);
    }
}
